package com.diu.domain.strategy.model.entity;

import com.diu.domain.strategy.model.vo.RuleLogicCheckTypeVO;
import lombok.*;

/**
 * @author #diu
 * @description #规则行动实体
 * @create #2025/10/10 11:13
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RuleActionEntity<T extends RuleActionEntity.RaffleEntity> {

    private String code = RuleLogicCheckTypeVO.ALLOW.getCode();
    private String info = RuleLogicCheckTypeVO.ALLOW.getInfo();
    private String ruleModel;
    private T data;


    static public class RaffleEntity{

    }
    @EqualsAndHashCode(callSuper = true)
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    static public class RaffleBeforeEntity extends RaffleEntity{
        /**
         * 策略ID
         */
        private Long strategyId;

        /**
         * 权重值Key；用于抽奖时可以选择权重抽奖
         */
        private String ruleWeightValueKey;

        /**
         * 奖品ID
         */
        private Integer awardId;
        /** 抽奖前置状态 */
        private String beforeState;
    }
    @EqualsAndHashCode(callSuper = true)
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    static public class RaffleMiddleEntity extends RaffleEntity{
        /** 抽奖中间状态 */
        private String middleState;
    }
    @EqualsAndHashCode(callSuper = true)
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    static public class RaffleAfterEntity extends RaffleEntity{
        /** 抽奖后置状态 */
        private String afterState;
    }
}
